package com.jade.linkong.service.impl;

import java.util.List;
import com.jade.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jade.linkong.mapper.LkInstructionsMapper;
import com.jade.linkong.domain.LkInstructions;
import com.jade.linkong.service.ILkInstructionsService;
import com.jade.common.core.text.Convert;

/**
 * 批示Service业务层处理
 * 
 * @author jade
 * @date 2020-08-13
 */
@Service
public class LkInstructionsServiceImpl implements ILkInstructionsService 
{
    @Autowired
    private LkInstructionsMapper lkInstructionsMapper;

    /**
     * 查询批示
     * 
     * @param id 批示ID
     * @return 批示
     */
    @Override
    public LkInstructions selectLkInstructionsById(Long id)
    {
        return lkInstructionsMapper.selectLkInstructionsById(id);
    }

    /**
     * 查询批示列表
     * 
     * @param lkInstructions 批示
     * @return 批示
     */
    @Override
    public List<LkInstructions> selectLkInstructionsList(LkInstructions lkInstructions)
    {
        return lkInstructionsMapper.selectLkInstructionsList(lkInstructions);
    }

    /**
     * 新增批示
     * 
     * @param lkInstructions 批示
     * @return 结果
     */
    @Override
    public int insertLkInstructions(LkInstructions lkInstructions)
    {
        lkInstructions.setCreateTime(DateUtils.getNowDate());
        return lkInstructionsMapper.insertLkInstructions(lkInstructions);
    }

    /**
     * 修改批示
     * 
     * @param lkInstructions 批示
     * @return 结果
     */
    @Override
    public int updateLkInstructions(LkInstructions lkInstructions)
    {
        lkInstructions.setUpdateTime(DateUtils.getNowDate());
        return lkInstructionsMapper.updateLkInstructions(lkInstructions);
    }

    /**
     * 删除批示对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteLkInstructionsByIds(String ids)
    {
        return lkInstructionsMapper.deleteLkInstructionsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除批示信息
     * 
     * @param id 批示ID
     * @return 结果
     */
    public int deleteLkInstructionsById(Long id)
    {
        return lkInstructionsMapper.deleteLkInstructionsById(id);
    }
}
